package com.example.test.advice.第六章_枚举和注解.建议86_在switch的default代码块中增加AssertionError错误;

public class Client {

    public static void main(String[] args) {
        printLogLevel(LogLevel.FATAL);
    }

    private static void printLogLevel(LogLevel logLevel){
        switch (logLevel){
            case DEBUG:
                System.out.println("日志输出为Debug");
                break;
            case INFO:
                System.out.println("日志输出为Info");
                break;
            case WARN:
                System.out.println("日志输出为Warn");
                break;
            case ERROR:
                System.out.println("日志输出为Error");
                break;
            default:
                throw new AssertionError("输入项未找到");
        }
    }
}
